<html>
<head>
<title>Decomb Plugin for Avisynth 2.5</title>
<link rel="stylesheet" type="text/css" href="../../style2.css">
</head>

<body>
<h1 align=center>Decomb Plugin for Avisynth<br>
(Version 5.1.0)<br>
Frequently Asked Questions (FAQ)</h1>

<h2 align=center>by Donald A. Graft</h2>
<p><hr><p>
<ul>
<li><a href="#jerky">My video sequences come out jerky, even when I don't decimate the clip.</a></li>
<li><a href="#dthresh">The <i>dthreshold</i> parameter is not working.</a></li>
<li><a href="#order">Why was Decomb 5.0.0 made field-order dependent?</a></li>
<li><a href="#small">Why am I getting some bad field matches?</a></li>
<li><a href="#changes">Why am I getting combed frames after some scene changes?</a></li>
<li><a href="#still">Even after a frame is deinterlaced, I still can see combing on it.</a></li>
<li><a href="#ants">I get "marching ants" on some hard horizontal edges when using FieldDeinterlace.</a>
<li><a href="#confused">I'm confused about the difference between <i>threshold</i> and <i>dthreshold</i>
in FieldDeinterlace.</a>
<li><a href="#ghosting">I get "ghosting" on my deinterlaced frames.</a>
<li><a href="#blending">Technically, what is the difference between blending and interpolation?</a>
<li><a href="#overriding">Different parts of my movie seem to require different <i>vthresh</i> values.
<li><a href="#guidance">How does <i>gthresh</i> affect the field matching when pattern guidance is enabled?</a>
</ul>

<p><hr size=2 width="100%" align=center>
<h3><a name=jerky>My video sequences come out jerky, even when I don't decimate the clip.</a></h3>
<p>Use post=4 (and post=5) rather than post=2 (and post=3). Also, do not set an unnecessarily low
<i>vthresh</i> parameter.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=dthresh>The <i>dthreshold</i> parameter is not working.</a></h3>
<p>The <i>dthreshold</i> parameter was renamed to <i>dthresh</i> in Telecide for Decomb 5.0.0.
It is still called <i>dthreshold</i> in FieldDeinterlace.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=order>Why was Decomb 5.0.0 made field-order dependent?</a></h3>
<p>It's faster and less error-prone to do 2 comparisons rather than 3. But Decomb 5.0.0 will
still try the third match if a frame is still combed after the 2-way match. So no extra combed
frames are emitted compared to Decomb 4. The tutorial provides a really easy way to determine
a clip's field order.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=small>Why am I getting some bad field matches?</a></h3>
<p>First, verify that your field order is set correctly using the procedure given in the tutorial!</p>
<p>The field matching process is not perfect. However, it can be improved in some situations.
For example, if you have a noisy clip (as you might get from an analog capture), you can often
improve the matching by using the <i>nt</i> parameter to add more noise tolerance than the default value of 10. The best value will depend on how noisy your clip is. But be cautious when raising the noise tolerance, because it can degrade matching for clean clips.</p>
<p>You can also improve matching in some cases by enabling pattern guidance. In some uncommon cases
you can improve matching by disabling pattern guidance! Try it both ways and see which gives you
better results.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=changes>Why am I getting combed frames after some scene changes?</a></h3>
<p>These scene changes require a third (backward) match. Decomb will test the third match only if <i>post</i>
is set to any value other than 0. Note that you can enable the third match testing
without enabling postprocessing: you can set post=1. You can also enable three-way matching on all
frames (not just ones that are combed after two-way matching) by using the <i>triple</i> parameter.
Setting triple=true, however, can produce jerkiness.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=still>Even after a frame is deinterlaced, I still can see combing on it.</a></h3>
<p>First, use post=3 or post=5 to verify that the frame is actually being deinterlaced. If it is not,
then you need to reduce your <i>vthresh</i> parameter until it is. If it is being deinterlaced, then
you can decrease the <i>dthresh</i> parameter to attack more areas of the frame, but see the caveat below.</p>
<p>Make sure that what you think is combing is really combing. For example, sometimes the clip has content
that is intentional but looks like combing. If you use SeparateFields() (by itself without Decomb)
and still see "combing" on the fields,
then it is not really combing but intentional content.
<p>If you have a color conversion before Decomb, be sure to use ConvertToXXX(interlaced=true).</p>
<p>Do not resize vertically before Decomb.</p>
<p><i>Caveat About Residual Combing</i>: People will often freeze on an frame and zoom in closely and see some
faint residual combing and agonize over it. But that is a seriously misguided way to assess residual
combing. Human perception cannot register contrast when the difference becomes less than a threshold.
But the threshold gets lower as the feature size gets larger. That means that when you zoom in, you
get an incorrect idea of what can actually be seen at normal size. Also, when things are in motion we
see them with reduced resolution; therefore, freezing the frame gives an incorrect idea of what can be
perceived. To assess residual combing, play the clip at normal speed and size. If it looks good, then
be happy!</p>
<p>Finally, reducing <i>dthresh</i> to low values (such as 0-5) throws away most of the advantages of the
area-based adaptive deinterlacing that Decomb performs. You will lose resolution on static areas of the
frames, where you want it the most.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=ants>I get "marching ants" on some hard horizontal edges when using FieldDeinterlace.</a></h3>
<p>This artifact is a consequence of the field-differencing algorithm employed by FieldDeinterlace. All
deinterlacers have characteristic faults like this. There is no perfect solution to deinterlacing. This is
usually seen at the edges of letterboxing. You can crop off the letterboxes first and restore them
afterwards (if you need them) as a workaround. Alternatively, you can use a frame-differencing
deinterlacer, such as TomsMoComp, if you can accept the characteristic artifacts of frame differencing.</p>
<p>I am exploring ways to reduce this artifact and hope for better performance in the future.

<p><hr size=2 width="100%" align=center>
<h3><a name=confused>I'm confused about the difference between <i>threshold</i> and <i>dthreshold</i>
in FieldDeinterlace.</a></h3>
<p>The process goes like this (if full = false): First the frame is tested to see if it is combed.
This is done by detecting combed areas and seeing if there is enough combing to reasonably declare
the frame as combed. The <i>threshold</i> parameter determines the sensitivity of the combing detection
in this step. Second, if the frame is declared as combed, the combed areas of the frame are again
detected but this time using the <i>dthreshold</i> parameter. The areas of the frame detected as combed
using <i>dthreshold</i> are then deinterlaced.
<p>
If full=true, the first step is omitted and all frames are declared as combed.
<p>
FieldDeinterlace's <i>map</i> parameter allows you to directly visualize the effect of these parameters.
</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=ghosting>I get "ghosting" on my deinterlaced frames.</a></h3>
<p>Refer to the <a href=#blending>question on blending versus interpolation</a>. To get rid of ghosting,
set blend=false.</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=blending>Technically, what is the difference between blending and interpolation?</a></h3>
<p>
Suppose you have 3 pixels on successive lines and the same x offset:
<pre>
a
b
c
</pre>
If you decide that pixel b is combed, and you replace it with (0.5*a+0.5*c) that is (linear)
interpolation. If you replace it with (0.25*a+0.5*b+0.25*c), that is blending. Note that when
interpolating, the even lines are passed through and the odd lines are calculated as described.
For blending, every line is calculated. Blending thus produces a blend of the two fields while
interpolation uses data from one field only. That is why people say that blending causes
"ghosting". You can eliminate the ghosting by setting blend=false.
Also note that while interpolation can be calculated
in place, blending cannot. Interpolation is a little faster.

<p><hr size=2 width="100%" align=center>
<h3><a name=overriding>Different parts of my movie seem to require different <i>vthresh</i> values.
What can I do?</a></h3>
<p>
The combing detector used by Decomb is quite sensitive but that can sometimes cause you trouble
when you have content that has sections that are not combed but have detail that looks like combing.
If you set <i>vthresh</i> high to avoid deinterlacing these areas, you may let combs slip through
elsewhere. While it's better to err on the side of caution and deinterlace some good frames, some
extreme cases make you wish you could set different <i>vthresh</i> values for different parts of
the clip. Fortunately, Decomb allows this through its manual override capability. Refer to the
reference manual for further details.
</p>

<p><hr size=2 width="100%" align=center>
<h3><a name=guidance>How does <i>gthresh</i> affect the field matching when pattern guidance is enabled?</a></h3>
<p>
If the pattern guidance thinks that the calculated (blind) field match is not what it predicts based on pattern analysis, it tries to override the blind field match. The override is allowed if the pattern mismatch is less than <i>gthresh</i>. Think of <i>gthresh</i> as a limiter: it limits how large the mismatch can be
before a predicted match is overruled by the actual calculated match. If your <i>gthresh</i> is too high,
it may cause a new pattern in the clip to be erroneously overridden by the previous pattern. There is a happy medium that allows new patterns to be locked onto quickly while still allowing the pattern guidance to
correct mismatches due to noise, etc. The happy medium is usually in the range 5-10%, but it will be
clip-specific.
</p>

<p><hr size=2 width="100%" align=center>
<p>Copyright &copy; 2003, Donald A. Graft, All Rights Reserved.</p>
<p>For updates and other filters/tools, visit my web site:<br>
<a href="http://shelob.mordor.net/dgraft/" target="_top">http://shelob.mordor.net/dgraft/</a>
</p>

</body>

</html>
